// 引入Service和请求头ServiceName
import { Service, ServiceName } from '@/network/http.js'
import store from '@/store/index.js' // 引入store

const api = {
    /**
        * 获取油价协力
        */
    getRateConditionData (params) {
        return Service.get(
            `/${ServiceName}/api/external/CostLilCooperationController/queryall`,{params}
        )
    },
    /**
      * 修改油价协力
      */
    updateData (params) {
        store.commit('changeStatus', true)
        return Service.put(
            `/${ServiceName}/api/external/CostLilCooperationController/update`,params
        )
    },
    /**
      * 根据id查询
      */
    getDataById (id) {
        return Service.get(
            `/${ServiceName}/api/external/CostLilCooperationController/querybyid?id=${id}`
        )
    },
    /**
     * 删除油价协力
     */
    deleteDate (id) {
        return Service.delete(
            `/${ServiceName}/api/external/CostLilCooperationController/deletebyid?id=${id}`
        )
    },
    /**
     * 新增油价协力
     */
    addDate (params) {
        store.commit('changeStatus', true)
        return Service.post(
            `/${ServiceName}/api/external/CostLilCooperationController/insert`,params
        )
    },
}

export default api
